//
// Created by linciping on 2020/9/15.
//
#include <stdio.h>
#include <stdlib.h>
#include <libavformat/avformat.h>
#include <libavutil/mathematics.h>
#include <libavutil/imgutils.h>
#include <libavutil/time.h>
#include <libswscale/swscale.h>

#define SIZE 3

typedef struct {
    const char *rtmpUrl;
    AVFormatContext *formatContext;
    AVCodecContext *codecContext;
    AVCodec *codec;
    int videoIndex;
    struct SwsContext *imgConvertContext;
    int index;
    int time;
    int timeFrameCount;
}FFmepgStruct;

typedef struct{
    FFmepgStruct *fFmepgStruct;
    int size;
    int maxSize;
}RtmpPool;

int initRtmpPool(RtmpPool *rtmpPool);

int add(RtmpPool *rtmpPool, FFmepgStruct fFmepgStruct);

int removeItem(RtmpPool *rtmpPool, const char* rtspUrl);

FFmepgStruct* get(RtmpPool rtmpPool, const char* rtspUrl);

int indexOf(RtmpPool rtmpPool, const char* rtspUrl);

int equals(const char *rtspUrl1,const char *rtspUrl2);

int length(RtmpPool rtmpPool);

int clear(RtmpPool *rtmpPool);




